package com.example.bootdemo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class BootDemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(BootDemoApplication.class, args);
	}

	@GetMapping("/")
	public String test(Integer integer) throws InterruptedException {
		integer = integer == null ? 0 : integer;
		System.out.println(integer);
		switch (integer) {
			case 1:
				Thread.sleep(10);
			case 2:
				Thread.sleep(100);
			case 3:
				Thread.sleep(1000);
			default:
				Thread.sleep(integer);
		}
		return "Hello World!";
	}
}
